home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Sample Code / SCSI Samples 1.0 / SCSI Simple Sample 06⁄15 ƒ / Src / DoGetDriveInfo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-16  |  1.0 KB  |  41 lines  |  [TEXT/KAHL]

  1. /*                                DoGetDriveInfo.c                                */
  2. /*
  3.  * DoGetDriveInfo.c
  4.  * Copyright © 1992-94 Apple Computer Inc. All Rights Reserved.
  5.  */
  6. #include "SCSISimpleSample.h"
  7.  
  8. /*
  9.  * Execute a Bus Inquiry SCSI request on the selected device. If it succeeds,
  10.  * display the results.
  11.  */
  12. void
  13. DoGetDriveInfo(
  14.         DeviceIdent                scsiDevice,                /* -> Bus/target/LUN    */
  15.         Boolean                    noIntroMsg,
  16.         Boolean                    useAsynchManager
  17.     )
  18. {
  19.  
  20.         ScsiCmdBlock                scsiCmdBlock;
  21.         SCSI_Inquiry_Data            inquiry;
  22. #define SCB    (scsiCmdBlock)
  23.         
  24.         if (noIntroMsg == FALSE)
  25.             ShowSCSIBusID(scsiDevice, "\pGet Drive Info");
  26.         CLEAR(SCB);
  27.         SCB.scsiDevice = scsiDevice;
  28.         SCB.command.scsi6.opcode = kScsiCmdInquiry;
  29.         SCB.command.scsi6.len = sizeof inquiry;
  30.         SCB.bufferPtr = (Ptr) &inquiry;
  31.         SCB.transferSize = sizeof inquiry;
  32.         SCB.transferQuantum = 1;                        /* Force handshake        */
  33.         /* All other command bytes are zero */
  34.         DoSCSICommandWithSense(&scsiCmdBlock, TRUE, useAsynchManager);
  35.         if (SCB.status == noErr)
  36.             DoShowInquiry(scsiDevice, &inquiry);
  37. #undef SCB
  38. }
  39.  
  40.         
  41.